package com.atguigu.ssm.controller;

import com.atguigu.ssm.pojo.User;
import com.atguigu.ssm.service.UserService;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @program: ssm_demo
 * @author: Mr.Zhuo
 * @create: 2022-03-29 20:17
 **/
@Controller
public class AdminController {

    @Autowired
    private UserService userService;

    @GetMapping("/login")
    public String login(User user) {

        // 进行登录
        Boolean flag = userService.login(user);

        if (flag) {
            return "index";
        } else {
            return "login";
        }

    }
}
